//
//  KDHomeThemeCell.m
//  PublicSentimentMonitorSystem
//
//  Created by 魏强 on 15/6/18.
//  Copyright (c) 2015年 魏强. All rights reserved.
//

#import "KDHomeThemeCell.h"
#import "KDHomeThemeModel.h"
@interface KDHomeThemeCell ()
/**
 *  内容label
 */
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIView *underView;
/**
 *  前面小点点
 */
@property (weak, nonatomic) IBOutlet UIImageView *pointView;

@end
@implementation KDHomeThemeCell
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellId =@"HomeThemeCell";
    UINib *xib = [UINib nibWithNibName:@"KDHomeThemeCell" bundle:nil];
    [tableView registerNib:xib forCellReuseIdentifier:cellId];
    tableView.separatorColor = BackGroundColor;
    KDHomeThemeCell *cell =[tableView dequeueReusableCellWithIdentifier:cellId];
    cell.underView.layer.cornerRadius = 5.0f;
    cell.backgroundColor = BackGroundColor;
    cell.layer.cornerRadius = 10.0f;
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
//    cell.
    //cell被选中时的颜色

    return cell;
}
- (void)setModel:(KDHomeThemeModel *)model
{
    _model = model;
    if ([model.parentName isEqualToString:@"维稳类"]) {
        self.pointView.image = [UIImage imageNamed:@"维稳点"];
    }else if ([model.parentName isEqualToString:@"治安类"]){
        self.pointView.image = [UIImage imageNamed:@"治安点"];
    }
    self.titleLabel.text = model.name;
    [self setNeedsLayout];
}
@end
